package com.ored.vshopcommon;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @Description:登录拦截器
 * @Author SGM
 * @Date 2020/3/15 16:00
 * @Version V1.0
 */
@WebFilter(filterName = "LoginFilter",urlPatterns = {"/login"})
public class LoginFilter implements Filter {
    private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoginFilter.class);

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("进入 Filter");
        filterChain.doFilter(servletRequest, servletResponse);
        log.info("登录拦截器");
        System.out.println("离开 Filter");
    }

    @Override
    public void destroy() {

    }
}
